This invention relates to controllers, extension boards and communication units.
It has been known to construct control systems in the industrial areas, such as for factory automation (FA), by appropriately combining a control unit (herein referred to as xe2x80x9ccontrollerxe2x80x9d) such as PLC and apparatus (herein referred to as xe2x80x9cdevicesxe2x80x9d) to be controlled by the controller. One or more devices may be connected to a PTC either directly or through a network and the PTC communicates with these devices, carrying out specified processes repeatedly and cyclically according to a user program. This is usually done by assigning on the network a unique node number as an identifier for each device and by specifying these node numbers (network addresses) to access the devices. In the case of a device connected through a bus, a unit number will be assigned instead of a node number, but the basic idea is the same. The actual communication of data is carried out by preliminarily assigning a memory address to be used by the devices on an I/O memory inside the PLC and the user program communicates with devices by writing into or reading from this memory.
Thus, it is required to set addresses of various kinds for the devices. Since the assignment of addresses is a cumbersome task, it is desirable to carry out this task automatically. An attractive environment would be where an address can be assigned to a device by a method of the so-called plug-and-play format (used in the world of office automation represented by personal computers) as soon as it is mounted.
While no more than several devices are connected to a personal computer, a much larger number of input and output devices are set on the network of a PLC and such devices are usually connected to I/O devices of sensors and relays (solenoids). Thus, hundreds and thousands of devices may end up being managed by a single PLC, and the plug-and-play format which may be good for a personal computer cannot always be utilized simple-mindedly.
It must also be remembered that if the resources of a PLC are assigned automatically, the resources to be accessed (such as memory addresses) may end up changing each time. Moreover, many user programs (such as ladder programs) for a PLC are prepared by directly writing within the program the addresses to be accessed. Thus, memory addresses which have been automatically assigned must be manually set inside the program. If the number of the connected devices is as large as explained above, the trouble may be enormous. If the memory addresses change frequently, furthermore, the program itself may have to be updated.
It is therefore an object of this invention to provide controllers, extension boards and communication units capable of using the plug-and-play format such that an extension can be easily made to include devices adapted for the plug-and-play format.
A controller embodying this invention, with which the above and other objects can be accomplished, may be characterized as comprising device detecting means, memory map setting means, communicating means and data transmitting means. The device detecting means is for detecting a device directly or indirectly connected to the controller and obtaining device identifying data thereon. The memory map setting means is for setting a device data area on a memory means contained in the controller, based on the obtained device identifying data, for transmitting and receiving data to and from the device and producing a memory map which correlates the device data area with a variable data area on the memory correlated to the device. The communicating means is for periodically transmitting and receiving data to and from the device according to the memory map by using the device data area on the memory means. The data transmitting means is for transmitting data according to the memory map between the variable data area on the memory means and the device data area.
In the above, direct connection means a connection to the controller through a bus or the like, and indirect connection means a connection through a network or a controller. Device identifying data are assigned to the individual devices for distinguishing them one from the others, including the serial number and the device name.
The controller is an apparatus capable of communicating with and controlling the operations of devices connected thereto. It may be any of apparatus that are used in factory automation in a broad sense of the expression, including an industrial robot. In a narrower sense of the expression, it may be a device for calculating and outputting output data to a solenoid coil or the like according to a control program prepared by the user in a manufacturing or production field based on input data, say, from a sensor, thereby controlling the motion of a target apparatus such as a robot, a cylinder, a motor and other moving elements on a production line.
What is herein referred to as a device may be any of various constituent elements on a production line adapted to receive input and output data to and from a controller through a network or a bus. Examples of a device include input devices such as sensors, switches, multi-point input terminals and cameras, output devices such as solenoid coils, multi-point output terminals, cylinders and motors, and combined input-output devices such as robots. The controller itself may operate as a combined input-output apparatus. In such a case, the controller can also be an example of what is herein referred to as a device.
According to this invention, since data on the memory can be transmitted to another data area by means of the data transmitting means, it is not necessary to write the addresses of devices directly in a program as external I/O variables. Even if a control program specifies a fixed variable data area, data can be transmitted to and from the device data area, and hence data can be exchanged with the devices through the communication means. Thus, even if the address of a device to be referenced is changed, it can still be referenced by updating the memory map without modifying the variable data area. In other words, it is possible to respond to a change in the address of a device without changing the control program.
Since device detecting and memory map setting means are provided, a memory map can be created automatically. Thus, descriptions (with variables) of control programs executed by the controller and detachably attachable devices can be automatically correlated such that a plug-and-play format can be operated and the control programs are always capable of accessing correct devices.
The controller may be provided further with correlation data storing means for storing correlation data for correlating the control program and the device such that the control program can access the device by referencing the correlation data to thereby identify an access destination (xe2x80x9caccess addressxe2x80x9d).
With such correlation data storing means thus provided, the control program can be written in a way independent of the system structure or the network structure. For example, I/O data for devices may be made accessible with variables. The concept of xe2x80x9cobjectxe2x80x9d is an advanced logical concept whereby data and programs for operating devices are inherently controlled such that the user can create and edit control programs without being conscious of the presence of internal data and internal programs. For example, different devices can be accessed similarly from a control program if the manners and contents of their specifications are the same.
An extension board embodying this invention is adapted to be detachably attached to a controller such as described above for controlled devices connected thereto, characterized similarly as comprising device detecting means, memory map setting means, and data transmitting means, as explained above. Since such an extension board is provided with the plug-and-play function, conventional controllers without this function can be operated in this format by having such an extension board attached thereto.
A communication unit embodying this invention is for communicating with devices adapted to be controlled by a controller to which it is connected and may be characterized similarly as comprising device detecting means, memory map setting means, and data transmitting means, as explained above. Like the extension boards described above, the communication unit according to this invention is provided with the plug-and-play function. Thus, a controller with the plug-and-play function can be formed by combining the main body unit of a conventional controller and a communication unit of this invention.